<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pyprocessing.mathfunctions</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyprocessing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pyprocessing-module.html">Package&nbsp;pyprocessing</a> ::
        Module&nbsp;mathfunctions
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pyprocessing.mathfunctions-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module mathfunctions</h1><p class="nomargin-top"><span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html">source&nbsp;code</a></span></p>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="noise"></a><span class="summary-sig-name">noise</span>(<span class="summary-sig-arg">*args</span>)</span><br />
      Returns the Perlin noise value at specified coordinates.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#noise">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__fade"></a><span class="summary-sig-name">__fade</span>(<span class="summary-sig-arg">t</span>)</span><br />
      Used internally by noise().</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#__fade">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__plerp"></a><span class="summary-sig-name">__plerp</span>(<span class="summary-sig-arg">t</span>,
        <span class="summary-sig-arg">a</span>,
        <span class="summary-sig-arg">b</span>)</span><br />
      Used internally by noise().</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#__plerp">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__grad"></a><span class="summary-sig-name">__grad</span>(<span class="summary-sig-arg">ha</span>,
        <span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">y</span>,
        <span class="summary-sig-arg">z</span>)</span><br />
      Used internally by noise().</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#__grad">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="binary"></a><span class="summary-sig-name">binary</span>(<span class="summary-sig-arg">*args</span>)</span><br />
      Converts a char or int to a string containing the equivalent binary 
      notation.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#binary">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="hex"></a><span class="summary-sig-name">hex</span>(<span class="summary-sig-arg">*args</span>)</span><br />
      Converts a char or int to a string containing the equivalent 
      hexadecimal notation.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#hex">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="unbinary"></a><span class="summary-sig-name">unbinary</span>(<span class="summary-sig-arg">value</span>)</span><br />
      Converts a string representation of a binary number to its equivalent
      integer value.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#unbinary">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="unhex"></a><span class="summary-sig-name">unhex</span>(<span class="summary-sig-arg">value</span>)</span><br />
      Converts a string representation of a hexadecimal number to its 
      equivalent integer value.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#unhex">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="byte"></a><span class="summary-sig-name">byte</span>(<span class="summary-sig-arg">value</span>)</span><br />
      Converts a char or int to its byte representation.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#byte">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="constrain"></a><span class="summary-sig-name">constrain</span>(<span class="summary-sig-arg">value</span>,
        <span class="summary-sig-arg">minv</span>,
        <span class="summary-sig-arg">maxv</span>)</span><br />
      Returns the constrained value so that it falls between minv and maxv.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#constrain">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pyprocessing.mathfunctions-module.html#dist" class="summary-sig-name">dist</a>(<span class="summary-sig-arg">*args</span>)</span><br />
      Calculates the Euclidean distance between two points.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#dist">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pyprocessing.mathfunctions-module.html#map" class="summary-sig-name">map</a>(<span class="summary-sig-arg">value</span>,
        <span class="summary-sig-arg">low1</span>,
        <span class="summary-sig-arg">high1</span>,
        <span class="summary-sig-arg">low2</span>,
        <span class="summary-sig-arg">high2</span>)</span><br />
      Re-maps a number from one range to another.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#map">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pyprocessing.mathfunctions-module.html#norm" class="summary-sig-name">norm</a>(<span class="summary-sig-arg">value</span>,
        <span class="summary-sig-arg">low</span>,
        <span class="summary-sig-arg">high</span>)</span><br />
      Normalizes a number from another range into a value between 0 and 1.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#norm">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pyprocessing.mathfunctions-module.html#mag" class="summary-sig-name">mag</a>(<span class="summary-sig-arg">*args</span>)</span><br />
      Calculates the magnitude (or length) of a vector.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#mag">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pyprocessing.mathfunctions-module.html#lerp" class="summary-sig-name">lerp</a>(<span class="summary-sig-arg">value1</span>,
        <span class="summary-sig-arg">value2</span>,
        <span class="summary-sig-arg">amt</span>)</span><br />
      Calculates a number between two numbers at a specific increment.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#lerp">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="sq"></a><span class="summary-sig-name">sq</span>(<span class="summary-sig-arg">value</span>)</span><br />
      Returns the square of value.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#sq">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="dist"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">dist</span>(<span class="sig-arg">*args</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#dist">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Calculates the Euclidean distance between two points. Arguments are of
  the form dist(x1,y1,x2,y2) dist(x1,y1,z1,x2,y2,z2)</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="map"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">map</span>(<span class="sig-arg">value</span>,
        <span class="sig-arg">low1</span>,
        <span class="sig-arg">high1</span>,
        <span class="sig-arg">low2</span>,
        <span class="sig-arg">high2</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#map">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Re-maps a number from one range to another. CAUTION: this function 
  overwrites Python's map builtin.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="norm"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">norm</span>(<span class="sig-arg">value</span>,
        <span class="sig-arg">low</span>,
        <span class="sig-arg">high</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#norm">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Normalizes a number from another range into a value between 0 and 1. 
  Identical to map(value, low, high, 0, 1).</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="mag"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">mag</span>(<span class="sig-arg">*args</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#mag">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Calculates the magnitude (or length) of a vector. Arguments are of the
  form mag(x,y) mag(x,y,z)</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="lerp"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">lerp</span>(<span class="sig-arg">value1</span>,
        <span class="sig-arg">value2</span>,
        <span class="sig-arg">amt</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pyprocessing.mathfunctions-pysrc.html#lerp">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Calculates a number between two numbers at a specific increment. The 
  amt parameter is the amount to interpolate between the two values where 
  0.0 equal to the first point, 0.1 is very near the first point, 0.5 is 
  half-way in between, etc</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyprocessing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Jun 11 22:06:46 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
